import request from '@/utils/request'

// 查询盈利预测关键指标(模板)列表
export function listDealIndicatorPredictKey(query) {
  return request({
    url: '/indicator/dealIndicatorPredictKey/list',
    method: 'get',
    params: query
  })
}

// 查询盈利预测关键指标(模板)详细
export function getDealIndicatorPredictKey(id) {
  return request({
    url: '/indicator/dealIndicatorPredictKey/' + id,
    method: 'get'
  })
}

// 保存盈利预测关键指标(模板)
export function saveDealIndicatorPredictKey(data) {
  return request({
    url: '/indicator/dealIndicatorPredictKey/save',
    method: 'post',
    data: data
  })
}

// 删除盈利预测关键指标(模板)
export function delDealIndicatorPredictKey(id) {
  return request({
    url: '/indicator/dealIndicatorPredictKey/' + id,
    method: 'delete'
  })
}

// 导出盈利预测关键指标(模板)
export function exportDealIndicatorPredictKey(query) {
  return request({
    url: '/indicator/dealIndicatorPredictKey/export',
    method: 'get',
    params: query
  })
}

export function getDealIndicatorKeyByCode(code, businessId, typeId) {
  if (businessId === undefined || businessId === null || businessId === '') {
    businessId = '-1'
  }
  if (typeId === undefined || typeId === null || typeId === '') {
    typeId = '-1'
  }
  return request({
    url: '/indicator/dealIndicatorPredictKey/getDealIndicatorKeyByCode/' + code + '/' + businessId + '/' + typeId,
    method: 'get'
  })
}
